/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-04
 * Time: 19:12
 */
class Person extends Thread{
    @Override
    public void run() {
        System.out.println("多线程执行");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
        }
    }
public class Test {
        public static void main(String[] args) {
                Person person = new Person();
                person.start();

                //主线程
                while (true) {
                    System.out.println("主线程");
                    try {
                        Thread.sleep(1000);
                    } finally {

                    }
                }
            }
        }
}
